#!/bin/bash

[ -n "$LKP_LOCAL_RUN" ] && exit

# check disk numbers for RAID

check_raid_disks()
{
	local raid_level=$1
	local raid_disks=$2

	[[ "$md_raid_level" = $raid_level ]] &&
	(( disk_nr_pmem < raid_disks )) &&
	(( disk_nr_brd < raid_disks )) &&
	(( disk_nr_srd < raid_disks )) &&
	(( disk_nr_hdd < raid_disks )) &&
	(( disk_nr_ssd < raid_disks )) && {
		echo "rm $job_file due to not enough disks for $md_raid_level"
		exit 1
	}
}

check_raid_disks 'raid0' 2
check_raid_disks 'raid1' 2
check_raid_disks 'raid5' 3
check_raid_disks 'raid6' 4

exit 0
